<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	</body>
</html>
<script type="text/javascript">
	// 生成器其实是一个特殊的函数
	// 异步编程 纯回调函数 node fs ajax mongodb
	// yield函数代码的分隔符
	function * gen(){
		console.log("hello")
		yield 'a';
		console.log("hello2")
		yield 'b';
		console.log("hello3")
		yield 'c';
		console.log("hello4")
	}
	let iterator = gen();
	console.log(iterator)
	iterator.next();
	iterator.next();
	iterator.next();
	iterator.next();
	
	for(let v of gen()){
		console.log(v)
	}
	
</script>
